package com.qinsoft.frame.common;

import java.util.Date;
import java.util.List;

import com.qinsoft.business.module.bean.Module;
import com.qinsoft.frame.utils.CodeUtil;
import com.taobao.api.internal.mapping.ApiField;

/**
 * 用户信息
 */
public class UserInfo {
	private Long loginTime = new Date().getTime();	//用户登陆时间
	private List<Module> module;        //访问权限
	private String level;               //用户等级
	private Long deadline;              //到期时间
	@ApiField("taobao_user_id")
	private Long userId;			    //用户id
	@ApiField("taobao_user_nick")
	private String nick;		        //用户nick
	@ApiField("access_token")
    private String sessionKey;          //Access token
	@ApiField("refresh_token")
    private String refreshToken;        //Refresh token
	@ApiField("expires_in")
    private Long expiresIn;             //Access token过期时间
	@ApiField("re_expires_in")
	private Long reExpiresIn;			//Refresh token过期时间
    
    public Long getLoginTime()
    {
        return loginTime;
    }
    
    public void setLoginTime(Long loginTime)
    {
        this.loginTime = loginTime;
    }
    
    public List<Module> getModule()
    {
        return module;
    }
    
    public void setModule(List<Module> module)
    {
        this.module = module;
    }
    
    public String getLevel()
    {
        return level;
    }
    
    public void setLevel(String level)
    {
        this.level = level;
    }
    
    public Long getDeadline()
    {
        return deadline;
    }
    
    public void setDeadline(Long deadline)
    {
        this.deadline = deadline;
    }
    
    public Long getUserId()
    {
        return userId;
    }
    
    public void setUserId(Long userId)
    {
        this.userId = userId;
    }
    
    public String getNick()
    {
        return nick;
    }
    
    public void setNick(String nick)
    {
        this.nick = CodeUtil.unescape(nick);
    }
    
    public String getSessionKey()
    {
        return sessionKey;
    }
    
    public void setSessionKey(String sessionKey)
    {
        this.sessionKey = sessionKey;
    }
    
    public String getRefreshToken()
    {
        return refreshToken;
    }
    
    public void setRefreshToken(String refreshToken)
    {
        this.refreshToken = refreshToken;
    }
    
    public Long getExpiresIn()
    {
        return expiresIn;
    }
    
    public void setExpiresIn(Long expiresIn)
    {
        this.expiresIn = expiresIn;
    }
    
    public Long getReExpiresIn()
    {
        return reExpiresIn;
    }
    
    public void setReExpiresIn(Long reExpiresIn)
    {
        this.reExpiresIn = reExpiresIn;
    }
}
